package com.itheima.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import com.itheima.result.Result;

@RestControllerAdvice
public class GlobalExceptionHandle {

    /**
     * 没有该账号异常
     * @param
     * @return
     */
    @ExceptionHandler(RuntimeException.class)
    public Result<?> noSuchAccountException(RuntimeException runtimeException){
        return Result.error(runtimeException.getMessage());
    }
}
